/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package poker.greentable;

import java.util.ArrayList;
import java.util.Collections;
import poker.cards.Card;

/**
 *
 * @author Norteromius
 */
public class Croupier {
    private String name = "Las Vegas croupier";
    
    
    public Croupier(){
        
    }
    
    
    /**
     * metoda mieszajaca karty
     * @param deck
     * @return 
     */
    public ArrayList<Card> mixDeck(ArrayList<Card> deck){
        ArrayList<Card> mixedDeck = deck;
        Collections.shuffle(mixedDeck);
        return mixedDeck;
    }
    
    public ArrayList<Player> dealRandomCards(ArrayList<Player> playerArr, ArrayList<Card> cardArr){
        //ArrayList<Player> tmpPlayerArr = playerArr;
        //ArrayList<Player> playerArr;
        
        for (int i = 0; i < 5; i++){
            for (int j = 0 ; j < playerArr.size(); j++){
                playerArr.get(j).addCard((Card)cardArr.get(0));
                cardArr.remove(0);
            }
        }
        
        return playerArr;
    }
    
    public ArrayList<Player> dealCards(ArrayList<Player> playerArr, ArrayList<Card> cardArr){
            ArrayList<Player> tmpPlayerArr = playerArr;
        
            for (int j = 0 ; j < tmpPlayerArr.size(); j++){
               /* tmpPlayerArr.get(j).addCard(new Card(2, 10));
                tmpPlayerArr.get(j).addCard(new Card(1, 2));
                tmpPlayerArr.get(j).addCard(new Card(2, 13));
                tmpPlayerArr.get(j).addCard(new Card(2, 11));
                tmpPlayerArr.get(j).addCard(new Card(2, 14));*/
                tmpPlayerArr.get(j).addCard(new Card(2, 10));
                tmpPlayerArr.get(j).addCard(new Card(1, 10));
                tmpPlayerArr.get(j).addCard(new Card(2, 10));
                tmpPlayerArr.get(j).addCard(new Card(2, 11));
                tmpPlayerArr.get(j).addCard(new Card(2, 14));
                cardArr.remove(0);
            }
        
        return tmpPlayerArr;    
    }


    public String getName()
    {
        return name;
    }

    public void setName(String name)
    {
        this.name = name;
    }
     
}
